/*
 * Spinner.hpp
 *
 *  Created on: 06-12-2010
 *      Author: Przemek
 */

#pragma once

#include "Container.hpp"
#include "ArrowButton.hpp"
#include "utils/RangedValue.hpp"

class Spinner: public Container
{
	private:
		static const float ARROW_WIDTH;
		RangedValue<int> value;
		ArrowButton* increaseArrow;
		ArrowButton* decreaseArrow;

	public:
		Spinner(const Range<int>& range, int value);

		void draw(const ClipArea& clipArea);

	private:
		void setButtonBounds();

		void mousePressed(const MouseListener::EventArguments& arguments);
		void keyPressed(const KeyListener::EventArguments& arguments);
};
